/*
 * Edge.cpp
 *
 *  Created on: 19/09/2009
 *      Author: Santi
 */

#include "Edge.h"

Edge::Edge(string id, string idFrom, string idTo, float length, float maxVelocity) {
	setId(id);
	setIdFrom(idFrom);
	setIdTo(idTo);
	setLength(length);
	setMaxVelocity(maxVelocity);
}

Edge::~Edge() {
	//std::cout << "Kill edge\n";
}

string Edge::getId() const
{
    return id;
}

void Edge::setId(string id)
{
    this->id = id;
}

string Edge::getIdFrom() const
{
    return idFrom;
}

void Edge::setIdFrom(string idFrom)
{
    this->idFrom = idFrom;
}

string Edge::getIdTo() const
{
    return idTo;
}

void Edge::setIdTo(string idTo)
{
    this->idTo = idTo;
}

float Edge::getLength() const
{
    return length;
}

void Edge::setLength(float length)
{
    this->length = length;
}

float Edge::getMaxVelocity() const
{
    return maxVelocity;
}

void Edge::setMaxVelocity(float maxVelocity)
{
    this->maxVelocity = maxVelocity;
}

float Edge::getTime() const {
	return ((float) (this->getMaxVelocity() / 3600.0 * 1000.0) / (float) (this->getLength() * 60.0));
}
